home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
novermdb.zip
/
NOVERMDB.FRM
< prev
next >
Wrap
Text File
|
1996-09-10
|
4KB
|
147 lines
VERSION 4.00
Begin VB.Form NoVerMDB
BorderStyle = 5 'Sizable ToolWindow
ClientHeight = 4005
ClientLeft = 195
ClientTop = 1440
ClientWidth = 8160
Height = 4410
Left = 135
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4005
ScaleWidth = 8160
ShowInTaskbar = 0 'False
Top = 1095
Width = 8280
Begin VB.ListBox ListFiles
Height = 5325
Left = 75
TabIndex = 0
Top = 30
Width = 5880
End
End
Attribute VB_Name = "NoVerMDB"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
'FRMNoVerMDB by LCL 100413.2733@compuserve.com
Option Explicit
Function SearchMDB(ByVal DiskLetter$, l As ListBox, chMsg$, ByVal QuelleEXT As String) As Integer
'FRMNoVerMDB by LCL 100413.2733@compuserve.com
ReDim tRep(0) As String
Dim Repertoire$, FileExt$, lo&, nDir&, nFile&
On Error Resume Next
l.Clear
Repertoire = Left(DiskLetter, 1) + ":\" '+ Left(CurDir, InStr(CurDir, ":")) + "\"
'NomVolume = Dir(Repertoire + "*.*", vbVolume)
Do Until Repertoire = "" Or Err > 0 Or DoEvents = 0
FileExt = Dir(Repertoire + "*.*", vbNormal + vbHidden + vbSystem + vbDirectory + vbArchive)
Do Until FileExt = "" Or Err > 0 Or DoEvents = 0
If GetAttr(Repertoire + FileExt) And vbDirectory Then
lo& = FileLen(Repertoire + FileExt)
If Err = 53 Or Err = 76 Then
'. .. Racine et Branche!...
Err = 0
Else
nDir& = nDir& + 1
ReDim Preserve tRep(UBound(tRep) + 1)
tRep(UBound(tRep)) = Repertoire + FileExt + "\"
'Debug.Print tRep(UBound(tRep))
End If
ElseIf UCase(Right(Repertoire + FileExt, 4)) = "." + QuelleEXT Then
l.AddItem Repertoire + FileExt
l.TopIndex = l.ListCount - 1
nFile& = nFile& + 1
Else
nFile& = nFile& + 1
End If
FileExt = Dir
Loop
Repertoire = tRep(UBound(tRep))
If UBound(tRep) = 0 Then
Else
ReDim Preserve tRep(UBound(tRep) - 1)
End If
Loop
If Err = 0 Then
chMsg = "Terminate with success for volume " + Left(CurDir, 2) + Chr(10) + _
Format(nDir) + " directories" + Chr(10) + _
Format(nFile) + " files"
Else
chMsg = "Error n░" + Format(Err) + " " + Error(Err)
End If
Erase tRep
SearchMDB = Err
Err = 0
End Function
Private Sub Form_Activate()
'FRMNoVerMDB by LCL 100413.2733@compuserve.com
Dim index As Integer, chMsg$
Dim db As Database, mdb$
MousePointer = vbHourglass
Screen.MousePointer = vbHourglass
Enabled = False
index = SearchMDB(IIf(Len(Command) = 0, CurDir, Command), listfiles, chMsg, "MDB")
Select Case index
Case 0
For index = 0 To listfiles.ListCount - 1
On Error Resume Next
mdb = listfiles.List(index)
Set db = Workspaces(0).OpenDatabase(mdb)
If Err = 0 Then
listfiles.List(index) = "V. " + db.Version + Chr(9) + mdb
Else
listfiles.List(index) = "Error " + Error(Err) + Chr(9) + mdb
End If
db.Close
Kill Left(mdb, Len(mdb) - 3) + "LDB"
Next index
Case Else
End Select
MousePointer = vbNormal 'vbHourglass
Screen.MousePointer = vbNormal 'vbHourglass
Enabled = True
MsgBox "Author : " + App.CompanyName + Chr(10) + _
App.LegalCopyright + Chr(10) + Chr(10) + _
chMsg + Chr(10) + Chr(10) + _
"Command : NoVerMDB.EXE [C:]", _
vbInformation, _
App.Title
End Sub
Private Sub Form_Load()
'FRMNoVerMDB by LCL 100413.2733@compuserve.com
On Error Resume Next
Caption = "LCL - Search n░version all Jet MDBs"
App.Title = Caption
Top = (Screen.Height - Height) / 2
Left = (Screen.Width - Width) / 2
End Sub
Private Sub Form_Resize()
'FRMNoVerMDB by LCL 100413.2733@compuserve.com
On Error Resume Next
listfiles.Top = 0
listfiles.Left = 0
listfiles.Width = ScaleWidth
listfiles.Height = ScaleHeight
End Sub